﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AG.Editor.ModelUI.Windows
{
    public partial class AGEInputAnchorPointWindow : Form
    {
        public Point AnchorPoint { get; set; }

        public AGEInputAnchorPointWindow(int anchorX, int anchorY)
        {
            InitializeComponent();

            ctlEditX.Text = anchorX.ToString();
            ctlEditY.Text = anchorY.ToString();
            AnchorPoint = new Point(anchorX, anchorY);
        }

        private void ctlBtnOK_Click(object sender, EventArgs e)
        {
            int anchorX = 0;
            int anchorY = 0;
            if (int.TryParse(ctlEditX.Text, out anchorX) && int.TryParse(ctlEditY.Text, out anchorY))
            {
                AnchorPoint = new Point(anchorX, anchorY);
                DialogResult = System.Windows.Forms.DialogResult.OK;
            }
        }
    }
}
